
import React, { Component } from 'react';
import { Actions } from 'react-native-router-flux'
import {
  StyleSheet,
  View,
  Text,
  FlatList,
} from 'react-native';
import Colors from '../../assets/colors'
import List from './table'
import Loading from '../../components/loading/loading'

export default class App extends Component<{}> {
  render() {

    const {dialogShow,dialogText,role,pageSize,pageChange,next,prev,last,page, loading,prjname,getId,
        list, queryTasks ,setProjectId,tableLastPage,sureJump,tableNextPage,change,changeText,search} = this.props
    return (
      <View style={styles.container}>
          {
            loading?<Loading />:
                  <FlatList
                      data={[
                              {key: 0, title: 'Table'}
                          ]}
                      renderItem={({item}) => <List
                        getId={getId}
                        prjname = {prjname} changeText = {changeText} search = {search}
                       next = {next} prev = {prev} last = {last} page = {page} sureJump={sureJump} role={role}
                       query={queryTasks} list={list} {...item} pageChange={pageChange} pageSize={pageSize}
                       tableLastPage={tableLastPage} tableNextPage={tableNextPage} change={change} dialogText={dialogText}
                       setProjectId={setProjectId} dialogShow = {dialogShow}/>}
                  />
          }
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    paddingTop: 22
  },
  item: {
    padding: 10,
    fontSize: 18,
    height: 4400,
  },
});




